<?php



/**
 * This class defines the structure of the 'station' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.ise-php.map
 */
class StationTableMap extends TableMap
{

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'ise-php.map.StationTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
		// attributes
		$this->setName('station');
		$this->setPhpName('Station');
		$this->setClassname('Station');
		$this->setPackage('ise-php');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('STATIONID', 'Stationid', 'INTEGER', true, 10, null);
		$this->addColumn('STATIONNAME', 'Stationname', 'VARCHAR', false, 255, null);
		$this->addColumn('PHONENR', 'Phonenr', 'VARCHAR', false, 50, null);
		$this->addForeignKey('POSTCODE', 'Postcode', 'INTEGER', 'city', 'POSTCODE', false, 5, null);
		$this->addColumn('STREET', 'Street', 'VARCHAR', false, 255, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
		$this->addRelation('City', 'City', RelationMap::MANY_TO_ONE, array('postcode' => 'postcode', ), null, null);
		$this->addRelation('Car', 'Car', RelationMap::ONE_TO_MANY, array('stationid' => 'stationid', ), null, null, 'Cars');
		$this->addRelation('Offers', 'Offers', RelationMap::ONE_TO_MANY, array('stationid' => 'stationid', ), 'CASCADE', null, 'Offerss');
		$this->addRelation('ReservationRelatedByPickup', 'Reservation', RelationMap::ONE_TO_MANY, array('stationid' => 'pickup', ), null, null, 'ReservationsRelatedByPickup');
		$this->addRelation('ReservationRelatedByDropoff', 'Reservation', RelationMap::ONE_TO_MANY, array('stationid' => 'dropoff', ), null, null, 'ReservationsRelatedByDropoff');
		$this->addRelation('Stationhours', 'Stationhours', RelationMap::ONE_TO_MANY, array('stationid' => 'stationid', ), 'CASCADE', null, 'Stationhourss');
	} // buildRelations()

} // StationTableMap
